from flask_wtf import FlaskForm
from wtforms.validators import DataRequired
from wtforms.fields import StringField, TextAreaField, SubmitField


class NewPostForm(FlaskForm):
    title = StringField(label='Title', validators=[DataRequired()], render_kw={'placeholder': 'Please set the title for blog'})
    body = TextAreaField(label='Body', validators=[DataRequired()])
    submit = SubmitField(label='submit')


class EditPostForm(FlaskForm):
    title = StringField(label='Title', validators=[DataRequired()], render_kw={'placeholder': 'Please set the title for blog'})
    body = TextAreaField(label='Body', validators=[DataRequired()])
    submit = SubmitField(label='确认修改')